package cn.xo68.sample.hazelcastdemo.config;

import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.hazelcast.HazelcastKeyValueAdapter;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.core.KeyValueTemplate;

import javax.xml.ws.WebEndpoint;
import java.util.Map;

/**
 * Created by nnsword on 2018/5/14.
 */
@Configuration
public class HazelcastConfig {
    private  static  final  String Key_test="cn.xo68.test";
    @Bean
    public HazelcastInstance hazelcastInstance(){
        return Hazelcast.newHazelcastInstance();
        // return HazelcastClient.newHazelcastClient();
    }
    @Bean
    public Map<String,String> hazelcastMap(){
       return hazelcastInstance().getMap(Key_test);
    }
}
